from leetcode_test import *
class Solution:
    def isRectangleOverlap(self, rec1: List[int], rec2: List[int]) -> bool:
        def check(Ax1, Ax2, Bx1, Bx2):
            if Ax2 <= Bx1 or Ax1 >= Bx2:
                return False 
            return True
        if check(rec1[0], rec1[2], rec2[0], rec2[2]) and check(rec1[1], rec1[3], rec2[1], rec2[3]):
            return True
        else:
            return False

# def test():
#     assert check(-1, 2, 0, 2)
#     assert check(0, 2, -1, 2)
#     assert check(0, 1, 1, 3) == False
#     assert check(0,1 ,2, 3) == False
#     assert check(0, 1, 1, 1) == False
#     assert check(0, 2, 1 ,3)
#     assert check(1, 3, 0 ,2)
#     assert check(1, 3, 2 ,2)


